<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
<script src="./gsap/gsap.js"></script>
  <style>
        .box {
      width: 270px;
      height: 50px;
      background-color: rgb(249, 197, 197);
      border-radius: 5px;
       transform: translateY(-200px)
    }
  </style>
</head>
<body>
  <button onclick="handler(event)">开始</button>
  <div class="box">Oops,this is a error message. <button onclick="handler1(event)">X</button></div>
  <script>
    function handler(event) {
    gsap.to('.box',{
      y:2,
      opacity: 1,
    
    })}
    function handler1(event) {
    gsap.to('.box',{
      Y:10,
     
      opacity:0,
    })
  }
  </script>
</body>
</html>